/**
 * 项目名称:
 *
 * @Author: 夏国倩
 * @Date: 2023/10/11 15:39
 * @Copyright
 */
package IO2;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.List;
/*
反序列化
 */
public class ObjectInputStreamTest2 {
    public static void main(String[] args) throws Exception{
        ObjectInputStream ois=new ObjectInputStream(new FileInputStream("users"));
        List<User> userList=(List<User>) ois.readObject();
        for (User user:userList){
            System.out.println(user);
        }
        ois.close();
    }
}
